//--------------------Sonic CD HUD Script---------------------//
//--------Scripted by Christian Whitehead 'The Taxman'--------//
//-------Unpacked By Rubberduckycooly's Script Unpacker-------//

// Priority
private alias 1 : PRIORITY_ACTIVE

private alias 114 : LEFTLIMIT

private alias Object.Value0 : Object.Timer
private alias Object.Value1 : Object.RightLimit
private alias Object.Value2 : Object.ScrollPos

private alias Object.Value5 : Object.LeftLight
private alias Object.Value6 : Object.RightLight
private alias Object.Value7 : Object.LeftDoor
private alias Object.Value8 : Object.RightDoor

private alias Object.Value9 : Object.LDoorSlide
private alias Object.Value10 : Object.RDoorSlide

private alias Object.Value11 : Object.OfficeAngle


private alias Object.Value12: Object.MiddleDoor
private alias Object.Value13 : Object.MDoorSlide


private alias Object.Value15 : Object.UsingMask
private alias Object.Value16 : Object.RButtonXPos
private alias Object.Value17 : Object.RightButtonPos
private alias Object.Value18 : Object.PowerTimer	
private alias Object.Value19 : Object.TouchTimer	//ayo
private alias Object.Value20 : Fan.FrameTimer
private alias Object.Value21 : Fan.Frame

private alias Object.Value22 : Object.RightSide
private alias Object.Value23 : Object.Flash
private alias Object.Value24 : Object.TableContainer

public table OfficeFlash
	32, 64, 96, 64
end table


private alias object[10].state : Freddy.State
private alias object[11].state : Bonnie.State
private alias object[12].state : Chica.State
private alias object[13].state : Foxy.State
private alias object[14].state : Endo.State	//he doesnt actually appear here but 
private alias object[15].state : GoldenFreddy.State	//he doesnt actually appear here but 
private alias object[16].state : Puppet.State	//he doesnt actually appear here but 
private alias object[17].state : Springtrap.State

private alias object[18].state : WitheredFreddy.State
private alias object[19].state : WitheredBonnie.State
private alias object[20].state : WitheredChica.State
private alias object[21].state : WitheredFoxy.State

private alias object[22].state : BalloonBoy.State
private alias object[23].state : JJ.State

private alias object[10].value4 : Freddy.AI
private alias object[11].value4 : Bonnie.AI
private alias object[12].value4 : Chica.AI
private alias object[13].value4 : Foxy.AI
private alias object[14].value4 : Endo.AI
private alias object[15].value4 : GoldenFreddy.AI
private alias object[16].value4 : Puppet.AI
private alias object[17].value4 : Springtrap.AI

private alias object[18].value4 : WitheredFreddy.AI
private alias object[19].value4 : WitheredBonnie.AI
private alias object[20].value4 : WitheredChica.AI
private alias object[21].value4 : WitheredFoxy.AI

private alias object[22].value4 : BalloonBoy.AI
private alias object[22].value4 : JJ.AI

public value LeftDoorClosed = 0;
public value RightDoorClosed = 0;
public value MiddleDoorClosed = 0;
public value UseMouse = 0;
public value OfficePower = 100;
public value CameraEnabled = 0;
public value PowerUsage = 1;
public value MaskMode = 0;
public value MaskEquipped = 0;
public value NightWon = 0;

public value LDoorLocked= 0;
public value RDoorLocked = 0;
public value MDoorLocked = 0;

public value LWindowScare= 0;
public value RWindowScare = 0;

public value PlayerJumpscared = 0;
public value OfficeScary = 0;

reserve function Office_LeftSide
reserve function Office_RightSide
reserve function Office_Controls
reserve function Office_PowerDraining
reserve function Office_MiddleDoor
reserve function Night_AI

function Night_AI
	switch stage.actnum
	case 1
		if stage.minutes < 2
			Freddy.AI = -1
			Bonnie.AI = -1
			Chica.AI = -1
			Foxy.AI = -1
			Endo.AI = -1
			GoldenFreddy.AI = -1
			Puppet.AI = -1
			Springtrap.AI = -1
		else
			Freddy.AI = 2
			Bonnie.AI = 4
			Chica.AI = 4
			Foxy.AI = 3
			Endo.AI = 0
			GoldenFreddy.AI = 0
			Puppet.AI = -1
			Springtrap.AI = -1
		end if
	break
	case 2
		Freddy.AI = 3
		Bonnie.AI = 5
		Chica.AI = 5
		Foxy.AI = 4
		Endo.AI = 2
		GoldenFreddy.AI = 2
		Puppet.AI = 1
		Springtrap.AI = 2
	break
	case 3
		Freddy.AI = 6
		Bonnie.AI = 7
		Chica.AI = 7
		Foxy.AI = 7
		Endo.AI = 4
		GoldenFreddy.AI = 3
		Puppet.AI = 1
		Springtrap.AI = 4
	break
	case 4
		Freddy.AI = 8
		Bonnie.AI = 10
		Chica.AI = 10
		Foxy.AI = 10
		Endo.AI = 8
		GoldenFreddy.AI = 5
		Puppet.AI = 1
		Springtrap.AI = 6
	break	
	case 5
		Freddy.AI = 10
		Bonnie.AI = 14
		Chica.AI = 14
		Foxy.AI = 12
		Endo.AI = 10
		GoldenFreddy.AI = 8
		Puppet.AI = 1
		Springtrap.AI = 8
	break		
	case 6
		Freddy.AI = 12
		Bonnie.AI = 16
		Chica.AI = 16
		Foxy.AI = 16
		Endo.AI = 12
		GoldenFreddy.AI = 12
		Puppet.AI = 1
		Springtrap.AI = 10
	break		
	case 7
		Freddy.AI = -1
		Bonnie.AI = -1
		Chica.AI = -1
		Foxy.AI = -1
		Endo.AI = -1
		GoldenFreddy.AI = -1
		Puppet.AI = -1
		Springtrap.AI = -1

		WitheredFreddy.AI	= -1
		WitheredBonnie.AI	= -1
		WitheredChica.AI	= -1
		WitheredFoxy.AI 	= -1
	break		
	end switch	
end function


function Office_MiddleDoor
	DrawSpriteScreenXY(33, Object.ScrollPos, 60)	//door
	if Object.MiddleDoor == 1	//open
		DrawSpriteScreenXY(34, Object.ScrollPos, 60)	//door
		if Object.MDoorSlide < 51
			Object.MDoorSlide += 8
		else
			Object.MDoorSlide = 51
		end if
		DrawSpriteScreenXY(32, Object.ScrollPos, Object.MDoorSlide)	//door
	else
		if Object.MDoorSlide > 0
			Object.MDoorSlide -= 8
		else
			Object.MDoorSlide = 0
		end if	
		DrawSpriteScreenXY(32, Object.ScrollPos, Object.MDoorSlide)	//door

	end if	

	DrawSpriteScreenXY(31, Object.ScrollPos, -32)
end function

function Office_PowerDraining

	Object.PowerTimer++

	if Object.PowerTimer == 600	
		//lose power

		//coded like this so it stacks, im sure theres a better way to do this	
		
		CheckEqual(Object.LeftLight, 1)
		temp2 = checkResult
		if temp2 == 1
			OfficePower--
		end if

		CheckEqual(CameraEnabled, 1)
		temp2 = checkResult
		if temp2 == 1
			OfficePower--
		end if

		CheckEqual(Object.LeftDoor, 1)
		temp2 = checkResult
		if temp2 == 1
			OfficePower--
		end if

		CheckEqual(Object.RightDoor, 1)
		temp2 = checkResult
		if temp2 == 1
			OfficePower--
		end if

		CheckEqual(Object.MiddleDoor, 1)
		temp2 = checkResult
		if temp2 == 1
			OfficePower--
		end if		

		CheckEqual(Object.RightLight, 1)
		temp2 = checkResult
		if temp2 == 1
			OfficePower--
		end if

		Object.PowerTimer = 0	
	end if

end function

function Office_Controls
	if OfficePower > 0
		temp0 = touchscreen[0].xpos
		temp0 -= screen.xcenter	
		if Object.ScrollPos > temp0
			if inputpress.buttona == 1
				if Object.LeftLight == 0

					if LWindowScare == 1
						PlaySfx(SfxName[Window Scare], 0)	
						LWindowScare = 0
					end if	

					Object.LeftLight = 1
					if Object.RightLight == 0
						PowerUsage++
					end if
				else
					if Object.LeftLight == 1
						StopSfx(SfxName[Hum])
						PowerUsage--
						Object.LeftLight = 0
					end if		
				end if	
			end if	

			if inputpress.buttonC == 1
				if LDoorLocked == 0
					if Object.LeftDoor == 0
						Object.LeftDoor = 1
						LeftDoorClosed = 1
						PowerUsage++
						PlaySfx(SfxName[Door], 0)	
					else
						if Object.LeftDoor == 1
							PowerUsage--
							LeftDoorClosed = 0
							Object.LeftDoor = 0
							LeftDoorClosed = 0
							PlaySfx(SfxName[Door], 0)	
						end if		
					end if	
				else
					PlaySfx(SfxName[Error], 0)	
				end if	
			end if	
		else
			if inputpress.buttona == 1
				if Object.RightLight == 0
					if RWindowScare == 1
						PlaySfx(SfxName[Window Scare], 0)	
						RWindowScare = 0
					end if			
					Object.RightLight = 1
					if Object.LeftLight == 0
						PowerUsage++
					end if
				else
					if Object.RightLight == 1
						PowerUsage--
						StopSfx(SfxName[Hum])
						Object.RightLight = 0
					end if		
				end if	
			end if	

			if inputpress.buttonC == 1
				if RDoorLocked == 0
					if Object.RightDoor == 0
						Object.RightDoor = 1
						RightDoorClosed = 1
						PowerUsage++
						PlaySfx(SfxName[Door], 0)	
					else
						if Object.RightDoor == 1
							PowerUsage--
							RightDoorClosed = 0
							Object.RightDoor = 0
							PlaySfx(SfxName[Door], 0)	
						end if		
					end if	
				else
					PlaySfx(SfxName[Error], 0)	
				end if	
			end if		

		end if


		if inputpress.buttonX == 1
			if MDoorLocked == 0
				if Object.MiddleDoor == 0
					Object.MiddleDoor = 1
					MiddleDoorClosed = 1
					PowerUsage++
					PlaySfx(SfxName[Door], 0)	
				else
					if Object.MiddleDoor == 1
						PowerUsage--
						MiddleDoorClosed = 0
						Object.MiddleDoor = 0
						PlaySfx(SfxName[Door], 0)	
					end if		
				end if	
			else
				PlaySfx(SfxName[Error], 0)	
			end if	
		end if


		if Object.LeftLight == 1
			Object.RightLight = 0
		end if
		if Object.RightLight == 1
			Object.LeftLight = 0
		end if
	end if	

end function

function Office_RightSide
	DrawSpriteScreenXY(18, Object.ScrollPos, 0)



	if Object.RightLight == 1
		if PlayerJumpscared == 1
			StopSfx(SfxName[Hum])
		else
			PlaySfx(SfxName[Hum], 1)	
		end if	
			
		//left door button
		DrawSpriteScreenXY(21, Object.ScrollPos, 0)

		if Freddy.State == 15
			//FREDDY AT THE DOOR!!!
			DrawSpriteScreenXY(26, Object.ScrollPos, 0)
		end if

		switch chica.state
		case 15
		case 16
			DrawSpriteScreenXY(28, Object.ScrollPos, 0)
		break
		end switch


		DrawSpriteScreenXY(20, Object.ScrollPos, 0)
	end if	

	
	if Object.RightDoor == 1	//open
		DrawSpriteScreenXY(19, Object.ScrollPos, 0) //left door button on
		if Object.RDoorSlide < 312
			Object.RDoorSlide += 18
		else
			Object.RDoorSlide = 312
		end if
		DrawSpriteScreenXY(23, Object.ScrollPos, Object.RDoorSlide)	//door
	else
		if Object.RDoorSlide > 0
			Object.RDoorSlide -= 18
		else
			Object.RDoorSlide = 0
		end if	
		DrawSpriteScreenXY(23, Object.ScrollPos, Object.RDoorSlide)	//door
	end if	

	//frame
	DrawSpriteScreenXY(22, Object.ScrollPos, 0)

end function

function Office_LeftSide

	//LEFT SIDE
	//left door button
	DrawSpriteScreenXY(12, Object.ScrollPos, 0)


	if Object.LeftLight == 1
		if PlayerJumpscared == 1
			StopSfx(SfxName[Hum])
		else
			PlaySfx(SfxName[Hum], 1)	
		end if		
		//left door button
		DrawSpriteScreenXY(15, Object.ScrollPos, 0)
		DrawSpriteScreenXY(14, Object.ScrollPos, 0)

		switch Bonnie.State 
		case 15
		case 16
			DrawSpriteScreenXY(27, Object.ScrollPos, 0)
		break
		end switch

	end if

	



	if Object.LeftDoor == 1	//open
		DrawSpriteScreenXY(13, Object.ScrollPos, 0) //left door button on
		if Object.LDoorSlide < 312
			Object.LDoorSlide += 18
		else
			Object.LDoorSlide = 312
		end if
		DrawSpriteScreenXY(17, Object.ScrollPos, Object.LDoorSlide)	//door
	else
		if Object.LDoorSlide > 0
			Object.LDoorSlide -= 18
		else
			Object.LDoorSlide = 0
		end if	
		DrawSpriteScreenXY(17, Object.ScrollPos, Object.LDoorSlide)	//door
	end if	

	//frame
	DrawSpriteScreenXY(16, Object.ScrollPos, 1)
end function

event ObjectMain
	//no title card?

	Callfunction(Night_AI)

	if Object[5].Type == TypeName[Blank Object]

		if PlayerJumpscared == 0
			if Object[9].Type == TypeName[Blank Object]
				if inputpress.Start == true
					
					// Disable start for this frame, this'll help with "double-pausing" cases
					inputpress.Start = false
				
					// Give different pause menus depending on if the player was brought here from the Dev Menu
					// (...but why?)
			
					// Pause the stage, this'll pause all the stage's objects too
					Stage.State = STAGE_PAUSED
					
					// and pause the stage's music, as well
					PauseMusic()
					// Create the Pause Menu and set it up as needed
					Object[9].Type = TypeName[Pause Menu]
					Object[9].DrawOrder = 6
					Object[9].Priority = 2
				end if
			end if
		end if	

	
		if OfficePower == 0
			PlaySfx(SfxName[PowerOut], 0)
			CheckEqual(NightWon, 0)
			temp0 = checkResult
			CheckEqual(PlayerJumpscared, 0)
			temp0 |= checkResult		
			if temp0 == 1	
				StopMusic()
			end if
		end if	


		if OfficePower <= 0
			StopSfx(SfxName[Fan])
			StopSfx(SfxName[Fan2])
			StopSfx(SfxName[Fan3])
		end if
			

		CallFunction(Office_PowerDraining)

		//Not using the camera?
		//Activate base office controls
		CheckEqual(CameraEnabled, 0)
		temp6 = checkResult
		CheckEqual(PlayerJumpscared, 0)
		temp6 &= checkResult	
		CheckEqual(NightWon, 0)
		temp6 &= checkResult
		if temp6 == 1

			//para android	touch rects
			CheckTouchRect(0, 0, screen.xsize, screen.ysize)
			if checkResult == -1
				Object.TouchTimer = false
			end if
			if Object.TouchTimer == 0
				//LEFT BUTTONS
				if Object.ScrollPos > 100

					temp0 = object.value0
					temp0 += 42
					temp1 = object.value0
					temp1 += 88
					CheckTouchRect(temp0, 96, temp1, 128)
					if CheckResult > -1
						Object.TouchTimer = 1
						inputpress.buttonC = 1
					end if

					temp0 = object.value0
					temp0 += 42
					temp1 = object.value0
					temp1 += 88
					CheckTouchRect(temp0, 130, temp1, 158)
					if CheckResult > -1
						Object.TouchTimer = 1
						inputpress.buttona = 1
					end if
				end if

				//RIGHT BUTTONS
				Object.RightButtonPos = 530
				Object.RightButtonPos -= screen.xsize
				not(Object.RightButtonPos)
				if Object.ScrollPos < Object.RightButtonPos
					temp0 = object.value0
					temp0 += screen.xsize
					temp0 -= 80
					temp1 = object.value0
					temp1 += screen.xsize
					temp1 -= 35
					CheckTouchRect(temp0, 96, temp1, 128)
					if CheckResult > -1
						Object.TouchTimer = 1
						inputpress.buttonC = 1
					end if
					temp0 = object.value0
					temp0 += screen.xsize
					temp0 -= 80
					temp1 = object.value0
					temp1 += screen.xsize
					temp1 -= 35	
					CheckTouchRect(temp0, 130, temp1, 158)
					if CheckResult > -1
						Object.TouchTimer = 1
						inputpress.buttona = 1
					end if
				end if

				//dont move with screen for fixed position
				temp0 = object.value2
				temp0 += 150
				temp1 = object.value2
				temp1 += 200
				CheckTouchRect(temp0, 82, temp1, 92)
				if CheckResult > -1
					object.TouchTimer = true
					PlaySfx(SfxName[Honk], 0)
				end if


				//dont move with screen for fixed position
				temp0 = object.value2
				temp0 += 195
				temp1 = object.value2
				temp1 += 230
				CheckTouchRect(temp0, 55, temp1, 85)
				if CheckResult > -1
					object.TouchTimer = true
					inputpress.buttonX = 1
				end if

			end if

			//for when the camera is down
		
			CallFunction(Office_Controls)
		
			//mouse controls

			//you scroll faster the farther you are on each side
			//based off mouse position on the xpos

			UseMouse = 1
			if UseMouse == 1
		
				if Object.ScrollPos < LEFTLIMIT
					if touchscreen[0].xpos < 170
						Object.ScrollPos += 3
					end if
				end if	
				if Object.ScrollPos < LEFTLIMIT
					if touchscreen[0].xpos < 120
						Object.ScrollPos += 4
					end if
				end if
				
				Object.RightLimit = 565
				Object.RightLimit -= screen.xsize
				not(Object.RightLimit)
				
			
				temp0 = screen.xcenter
				temp0 += 50
				if Object.ScrollPos > Object.RightLimit
					if touchscreen[0].xpos > temp0
						Object.ScrollPos -= 3
					end if
				end if
				temp0 = screen.xcenter
				temp0 += 90
				if Object.ScrollPos > Object.RightLimit
					if touchscreen[0].xpos > temp0
						Object.ScrollPos -= 4
					end if
				end if



			else	//manual controls if your like that ig


				Object.RightLimit = 565
				Object.RightLimit -= screen.xsize
				not(Object.RightLimit)
				if Object.ScrollPos > Object.RightLimit
					if inputdown.right == 1
						Object.ScrollPos -= 7
					end if
				end if

				if Object.ScrollPos < LEFTLIMIT
					if inputdown.left == 1
						Object.ScrollPos += 7
					end if
				end if				

				
					
				
			end if	
		end if


		if object[30].type != TypeName[Blank Object]
			//dont move with screen for fixed position
			temp0 = 0
			temp1 = object.value2
			temp1 -= 15
			CheckTouchRect(temp0, 0, temp1, 30)
			if CheckResult > -1
				object.TouchTimer = true
				StopSfx(SfxName[Phone])
				object[30].type = TypeName[Blank Object]
			end if
		end if

		//bar
		if PlayerJumpscared == 0
			MaskMode = 1		
			if MaskMode == 0
				CheckTouchRect(0, 208, screen.xsize, 240)
				if CheckResult > -1
					Object.TouchTimer = 1
					inputpress.down = 1
				end if
			else
				//camera
				temp0 = screen.xsize
				temp0 /= 2
				CheckTouchRect(0, 208, temp0, 240)
				if CheckResult > -1
					Object.TouchTimer = 1
					inputpress.down = 1
				end if
				if CameraEnabled == 0
					temp0 = screen.xsize
					temp1 = screen.xcenter
					CheckTouchRect(temp1, 208, temp0, 240)
					if CheckResult > -1
						Object.TouchTimer = 1
						inputpress.buttonY = 1
					end if
				end if	
			end if
		end if
	end if
end event

event ObjectDraw

	//filler
	DrawRect(0, 0, Screen.XSize, Screen.YSize, 0, 0, 0, 255)

	//office
	if PlayerJumpscared == 1
	
	end if
	DrawSpriteScreenXY(10, Object.ScrollPos, Object.OfficeAngle)


	CallFunction(Office_LeftSide)
	CallFunction(Office_RightSide)

	//office
	//i have no clue how this works its from CD Sonic code
	if OfficePower > 0
		Fan.Frame = 24
		Fan.FrameTimer += 128
		
		if Fan.FrameTimer > 239
			Fan.FrameTimer -= 240
			
			Fan.Frame++
			if Fan.Frame > 26
				Fan.Frame = 2
			end if
		end if
		DrawSpriteScreenXY(Fan.Frame, Object.ScrollPos, 0)
	end if



	
	Callfunction(Office_MiddleDoor)



	if OfficePower <= 0
		CameraEnabled = 0
		LDoorLocked = 1
		RDoorLocked = 1
		MDoorLocked = 1
		LeftDoorClosed = 0
		RightDoorClosed = 0
		MiddleDoorClosed = 0		
		Object.LeftDoor = 0
		Object.RightDoor = 0	
		Object.MiddleDoor = 0	

		if Object.LeftLight == 1
			Object.RightLight = 0
		end if
		if Object.RightLight == 1
			Object.LeftLight = 0
		end if

		DrawRect(0, 0, screen.xsize, screen.ysize, 0, 0, 0, 224)// 1
	end if



//	temp0 = Object.ScrollPos
//	abs(temp0)
//	DrawNumbers(0, 32, 96, Object.TableContainer, 3, 8, 0)

end event


event ObjectStartup
	
	LoadSpriteSheet("FNAF/Objects.gif")
	
	// Place the HUD object into reserved object slot 4 and initialise its values
	Object[2].Type = TypeName[Office]
	
	// The object should always be run, regardless if it's within camera bounds or not
	Object[2].Priority = PRIORITY_ACTIVE
	
	// Make the HUD draw ontop of all other sprites, too
	Object[2].DrawOrder = 4

	Object[2].ScrollPos = 50

	Object[2].OfficeAngle = 0

	SetMusicTrack("OfficeVibes.ogg", 0, 1)
	SetMusicTrack("OfficeLose.ogg", 1, 0)
	SetMusicTrack("BearWin.ogg", 2, 0)
	SetMusicTrack("JackInBox.ogg", 3, 94036)
	// 0-9 - Numbers 0-9
	SpriteFrame(0, 0, 8, 13, 558, 1)
	SpriteFrame(0, 0, 8, 13, 567, 1)
	SpriteFrame(0, 0, 8, 13, 576, 1)
	SpriteFrame(0, 0, 8, 13, 585, 1)
	SpriteFrame(0, 0, 8, 13, 594, 1)
	SpriteFrame(0, 0, 8, 13, 558, 15)
	SpriteFrame(0, 0, 8, 13, 567, 15)
	SpriteFrame(0, 0, 8, 13, 576, 15)
	SpriteFrame(0, 0, 8, 13, 585, 15)
	SpriteFrame(0, 0, 8, 13, 594, 15)

	//SpriteFrame(-115, -1, 556, 253, 1, 1) // 10 - office og

	SpriteFrame(-115, -56, 682, 426, 1, 509) // 10 - office

	// 11 - mice
	SpriteFrame(0, 0, 12, 21, 1011, 1)


	//Left

	// 12 - Left Buttons
	SpriteFrame(-72, 96, 33, 66, 684, 509)	

	// 13 - 14, Door Lit, Light Lit
	SpriteFrame(-72, 96, 33, 34, 719, 509)	
	SpriteFrame(-72, 128, 33, 34, 719, 541)	//loght	

	//15 left door lit empty
	SpriteFrame(-34, -1, 134, 327, 684, 643)

	//16 left door empty frame
	SpriteFrame(-34, -40, 95, 369, 565, 139)	
	//17 left door
	SpriteFrame(-27, -302, 84, 314, 661, 194)	


	//Right

	// 18 - right Buttons
	SpriteFrame(490, 96, 33, 66, 684, 576)	

	// 19 - 20, Door Lit, Light Lit
	SpriteFrame(490, 96, 33, 34, 719, 576)	
	SpriteFrame(490, 128, 33, 34, 719, 608)	//loght	

	//21 right door lit empty
	SpriteFrame(352, -1, 134, 327, 819, 643)

	//22 right door empty frame
	SpriteFrame(391, -40, 95, 369, 831, 139)	
	//23 right door
	SpriteFrame(395, -302, 84, 314, 746, 194)	

	//24 fan animation frames
	SpriteFrame(218, 122, 40, 48, 794, 509)	
	//25 
	SpriteFrame(218, 122, 40, 48, 753, 509)		
	
	//fred 26 
	SpriteFrame(440, 67, 42, 126, 954, 643)		
	//bun 27
	SpriteFrame(-33, 46, 125, 188, 244, 1)		
	//jockey 28
	SpriteFrame(352, 41, 41, 118, 954, 770)	
	//golden gang 29
	SpriteFrame(140, 41, 166, 169, 370, 1)	

	//spring trap eyes
	SpriteFrame(225, 46, 62, 34, 621, 936)		//30

	//Middle Door Overlay
	SpriteFrame(225, 12, 62, 76, 437, 935)		//31

	//MiddleDoor
	SpriteFrame(226, 1, 61, 39, 499, 936)		//32

	//buton mid
	SpriteFrame(201, -2, 23, 23, 302, 936)		//33
	SpriteFrame(201, -2, 23, 23, 326, 936)		//34


	//flash ig? lol
	SpriteFrame(-128,-128,256,256,1,252)	//35
end event


// ========================
// Editor events
// ========================

event RSDKDraw
	DrawSprite(0)
end event


event RSDKLoad
	LoadSpriteSheet("3D_Test/Objects.gif")
	SpriteFrame(0, 0, 24, 16, 206, 58)

	SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")
end event
